package com.centriole.common.component;

import org.springframework.stereotype.Component;

@Component
public class ContextUtils {

    public static String workflowPrefix() {
        return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-WORKFLOW" );
    }

    public static String logPrefix() {
        return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-LOG");
    }

    public static String routeContext(String contextPath) {
        if (contextPath.contains("log")) {
            return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-LOG");
        }else if(contextPath.contains("workflow")){
            return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-WORKFLOW");
        }
        return null;
    }

    public static String redisPerfix() {
        return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-REDIS");
    }

    public static String mainDataPerfix() {
        return EurekaClientUtils.getServiceUrlByRamdon("SERVICE-MAIN-DATA");
    }
}
